package com.tjbklx1.zk.zookeeper.createSessionSync;

import java.io.IOException;

import org.apache.zookeeper.ZooKeeper;

public class CreateSessionSync {

	private static ZooKeeper zooKeeper;

	public static void main(String[] args) throws IOException, InterruptedException {
		
		MyWatcher watcher = new MyWatcher();
		zooKeeper = new ZooKeeper("127.0.0.1:2181", 5000, watcher);
		watcher.setZooKeeper(zooKeeper);
		
		System.out.println(zooKeeper.getState());
		Thread.sleep(Integer.MAX_VALUE);

	}
}
